﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using Maticsoft.Common;
using LTP.Accounts.Bus;
namespace lcmyjobs.Web.feedbacks
{
    public partial class Add : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                this.Title = string.Format("{1}人才网   {1}招聘网   {1}猎头网   {1}求职网   {0}—反馈与投诉", Application["webname"].ToString(), Application["webregion"].ToString());
            }

                       
        }
       

        protected void btnSave_Click(object sender, EventArgs e)
		{
            if (Page.IsValid)
            {
                string fip = myPublic.GetIp();
                string checkcode = this.txtCode.Text;
                if (fip != "1.1.1.1")
                {
                    if (Session["CheckCode"] != null)
                    {
                        if (checkcode.ToUpper() == Session["CheckCode"].ToString())
                        {
                            string ftext = myPublic.SafetyStr(this.txtftext.Text);
                            string fname = this.txtfname.Text;
                            string phone = this.txtphone.Text;
                            string email = this.txtemail.Text;
                            lcmyjobs.Model.feedbacks model = new lcmyjobs.Model.feedbacks();
                            model.ftext = ftext;
                            model.fname = fname;
                            model.phone = phone;
                            model.email = email;
                            model.fip = fip;
                            lcmyjobs.BLL.feedbacks bll = new lcmyjobs.BLL.feedbacks();
                            int i=bll.Add(model);
                            if (i == 0|| i==-1)
                            {
                                Maticsoft.Common.MessageBox.Show(this, "为防止非法分子攻击，一天只能提一个建议，谢谢您的合作，没有成功！");
                            }
                            Maticsoft.Common.MessageBox.Show(this, "谢谢您的建议！");

                        }
                        else
                            Maticsoft.Common.MessageBox.Show(this, "验证码不对！");
                    }
                    else
                        Maticsoft.Common.MessageBox.Show(this, "验证码不对！");
                }
                else
                {
                    Maticsoft.Common.MessageBox.Show(this, "IP地址非法！");

                }
               
            }
		}


        public void btnCancle_Click(object sender, EventArgs e)
        {
            //Response.Redirect("list.aspx");
        }

        protected void txtftext_TextChanged(object sender, EventArgs e)
        {

        }
    }
}
